import 'package:flutter/material.dart';
import '../util/dio_util.dart';
import '../util/my_colors.dart';
import '../custom_widget/my_drawer.dart';
import '../custom_widget/post_item.dart';

class SocialHubPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return _PageBody();
  }
}

class _PageBody extends StatefulWidget {
  @override
  __PageBodyState createState() => __PageBodyState();
}

class __PageBodyState extends State<_PageBody>
    with SingleTickerProviderStateMixin {
  AppBar _appBar = AppBar(
    title: Text("圈子"),
  );

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: _appBar,
      drawer: MyDrawer(),
      body: _getBody(),
    );
  }

  Widget _getBody() {
    return Container(
        color: MyColors.mainColor,
        width: MediaQuery.of(context).size.width,
        height:
            MediaQuery.of(context).size.height - _appBar.preferredSize.height,
        child: Column(
          children: <Widget>[
            PostItem(DioUtil.head_url + "news/test1.jpg", "测试数据",
                DioUtil.head_url + "user_head.png", "测试", 10),
          ],
        ));
  }
}
